@extends('layouts.app-en')

@section('title', 'Home')

@section('header')
    @include('layouts.header-en')
@stop

@section('content')
		<div class="wrapper-en">
			<div class="publish">
	            <div class="container">
	                <div class="title">
	                    <h2><span class="sr-only">版贸书讯</span></h2>
	                </div>
					@if ($slide_show)
	                <div id="carousel" class="carousel slide" data-ride="carousel">
	                    <div class="carousel-inner" role="listbox">
	                        @foreach ($slide_show as $key => $item)
	                        <div class="item @if($key == 0) active @endif">
	                            <a target="_blank" href="{{$item->link}}">
	                                <img src="{{ asset('uploads/' . $item->image) }}" alt="">
	                                <div class="date clearfix">
	                                    <div class="date-bg"></div>
	                                    <span class="date-month f_left">{{ date('d',strtotime($item->date_time)) }}</span>
	                                    <div class="data-right f_left">
	                                        <span class="date-day">{{ date('m',strtotime($item->date_time)) }}</span>
	                                        <span class="date-month-name">Month</span>
	                                    </div>
	                                </div>
	                                <div class="carousel-caption">
	                                    <h3>{{$item->title }}</h3>
	                                    <p>{{ $item->summary }}</p>
	                                </div>
	                            </a>
	                        </div>
	                       @endforeach
	                    </div>
	                    <a class="left carousel-control" href="#carousel" role="button" data-slide="prev">
	                        <i class="carousel-icon-left"></i>
	                    </a>
	                    <a class="right carousel-control" href="#carousel" role="button" data-slide="next">
	                        <i class="carousel-icon-right"></i>
	                    </a>
	                </div>
					@endif
	                <div class="publish-trade">
	                    <div class="row">
	                        @foreach ($trade_activities as $list)
	                        <div class="col-md-4">
	                            <div class="publish-trade-item">
	                                <a target="_blank" href="{{$list->link}}">
	                                    <div class="item-img">
	                                        <img src="{{ asset('uploads/' . $list->image) }}" alt="" />
	                                    </div>
	                                    <div class="item-content">
	                                        <h4>{{ $list->title }}</h4>
	                                        <p>{{ str_limit($list->summary, 135, '...') }}</p>
	                                    </div>
	                                </a>
	                            </div>
	                        </div>
	                        @endforeach
	                    </div>
	                </div>
	            </div>
	        </div>
			<div class="achievement">
				<div class="container">
					<div class="bg"></div>
					<div class="achievement-inner">
						<div class="achievement-leader">
							<div class="title">
								<h2>成果展示</h2>
								<h3>OUR BOOKS</h3>
								<div class="decorate2"></div>
							</div>
						</div>
						<div class="more">
							<a href="{{ route('enTrade') }}"><h3>MORE &rsaquo;</h3></a>
						</div>
						@foreach($trade_recommends as $key => $recommend)
							@if($key < 2)
								@if($key == 0)
									<div class="hot-topic-inner">
										<div class="row">
								@endif
									<div class="col-md-6">
										<a href="{{ route('productInfo', ['uuid' => $recommend->product->uuid, 'language' => 'en']) }}" target="_blank" class="achievement-item clearfix">
											<div class="hot-topic-img">
												<img src="{{ asset('uploads/' . $recommend->product->cover[0]) }}" alt="{{ $recommend->product->name }}">
											</div>
											<div class="hot-topic-tab">
												<h4>{{ $recommend->product->name }}</h4>
												{{--<h5>适用：{{ $recommend->product->details->grade }}</h5>--}}
												<p>{{ $recommend->product->summary }}</p>
											</div>
										</a>
									</div>
								@if($key == 1)
									</div>
								</div>
								@endif
							@else
								@if($key == 2)
									<div class="our_books">
										<div class="row">
								@endif
											<div class="hot-topic-img">
												<a href="{{ route('productInfo', ['uuid' => $recommend->product->uuid, 'language' => 'en']) }}" target="_blank">
													<img src="{{ asset('uploads/' . $recommend->product->cover[0]) }}" alt="{{ $recommend->product->name }}">
												</a>
											</div>
								@if($loop->last)
										</div>
									</div>
								@endif
							@endif
						@endforeach
					</div>
		            <div class="decorate1"></div>
				</div>
			</div>
			<div class="company" id="company-info">
				<div class="container">
					<div class="company-wrapper">
						<div class="title">
							<h2><span class="sr-only">公司介绍</span></h2>
						</div>
						<div class="company-content">
							<h3>Guangdong Petrel Electronic & Audio-Visual Publishing House</h3>
							@if($companyInfo)
								<p>{!! $companyInfo->summary !!}</p>
							@else
								<p>{{ config('company_intro_en')}}</p>
							@endif
						</div>
						<div class="company-contact">
							@if($companyInfo)
								<p><span>Address：</span><span>{{ $companyInfo->address }}</span></p>
								<p><span>Phone：</span><span>{{ $companyInfo->telephone }}</span></p>
								<p><span>Fax：</span><span>{{ $companyInfo->fax }}</span></p>
								<p><span>Email：</span><span>{{ $companyInfo->email }}</span></p>
								<p><span>Web：</span><span>{{ route('index') }}</span></p>
							@else
								<p><span>Address：</span><span>{{ config('address_en')}} </span></p>
								<p><span>Phone：</span><span>{{ config('contact_telephone')}} </span></p>
								<p><span>Fax：</span><span>{{ config('fax')}} </span></p>
								<p><span>Email：</span><span>{{ config('email')}} </span></p>
								<p><span>Web：</span><span>{{ config('website')}} </span></p>
							@endif
						</div>
					</div>
				</div>
			</div>
		</div>
	@stop

	@section('footer')
		@include('layouts.footer-en')
	@stop

	@section('script')
	<script>
	  	//---------- back top -------------//
	    $("#scroll").click(function(){
	        $('body,html').animate({scrollTop:0},500);
	        return false;
	    });
	</script>
	@stop
